package cn.im.qywx.wx.component.mainmenu;


import cn.im.qywx.model.ImWxUserInfo;
import cn.im.qywx.wx.component.Component;
import cn.im.qywx.wx.component.ComponentType;
import cn.im.qywx.wx.util.WriteWeiXinMsgXml;

/**
 * @Description: 主导航组件
 */
public class MainMenuCom extends Component {

	@Override
	public void execute(ImWxUserInfo userInfo ) {
		
		String pubStr;
		
		String token = String.valueOf(System.currentTimeMillis());
		
		// 如果是语言
		/*if ("voice".equals(userInfo.getQueueInfo().getWxXml().getMsgType().toLowerCase()) && !userInfo.getQueueInfo().isVoiceOk()) {
			pubStr = "识别出您的语音输入为 ( " + 
				(StringUtils.isNotBlank(userInfo.getQueueInfo().getWxXml().getRecognition()) ? userInfo.getQueueInfo().getWxXml().getRecognition() : " ") 
				+ " )" 
				+ "很抱歉，听不懂您的意思。"
				+ "请再试试用简单的关键词获取服务！";
		} else {
			pubStr = "大奖等你哦！<a href = \"http://baidu.com/luckyDraw?openId="+userInfo.getWeixinno()+"&code&time="+token+"\">【立即参加】</a>";
		}*/
		pubStr = "暂不支持此操作，等待后续开发中...";
		
		super.setParams(userInfo, ComponentType.MainMenu, pubStr, new WriteWeiXinMsgXml());
	}
}